<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<html>
<head>
    <script type="text/javascript">
        function deleteTorneo() {
            if (confirm("Desea eliminar el torneo?")) {
                return true;
            }
            return false;
        }
    </script>
</style>
</head>
 
<body>
<div class="container">
    <div class="row"><br><br>
    <h2>Listado de Torneos</h2>
    <h5>Criterios de Busqueda</h5>
    <div class="hero-unit-min">
                <!--div class="clear"></div-->
                <div class="buscar-form">
                <form:form action="buscar" method="post" commandName="criterioBusqueda">
                <table border=0 cellspacing=2 cellpadding=4 width="100%" height="50px" bordercolor=red >
                <tr>
                    <td>Torneo</td>
                    <td><form:input path="nombre" size="10" cssClass="input-large"></form:input>
                    </td>
                    <!---td>
                        <input type="submit" value="Buscar" class="btn btn-mini btn-primary"/>
                    </td-->
                </tr>
		<tr>
                    <td colspan="6" align="right">
                        <input type="submit" value="Buscar" class="btn btn-mini btn-primary"/>
                        <a href="<c:url value='/pages/torneo/new'/>" class="btn btn-mini btn-primary">Nuevo</a>
                    </td>
		</tr>                
                </table>
                </form:form>
                </div>  
     </div>
    </div>
    <br/>
    <div class="bs-docs-example">
    <table class="table table-hover">
        <tr>
            <th>#</th>
            <th>Torneo</th>
            <th>Participantes</th>
            <th>Contendores</th>
            <th>Fecha Lanz.</th>
            <th>Fecha Cierre</th>
            <th>Estado</th>
            <th style="width: 150px;"></th>
            <th style="width: 150px;"></th>
        </tr>
        <c:forEach var="torneo" items="${torneo}">
            <tr>
                <td>${torneo.idtorneo}</td>
                <td>${torneo.notorneo}</td>
                <td>${torneo.qtparticipantes}</td>
                <td>${torneo.qtcontendores}</td>
                <td>${torneo.fclanzamiento}</td>
                <td>${torneo.fccierre}</td>
                <td>Activo</td>
                <td><a href="<c:url value='/pages/torneo/edit?id=${torneo.idtorneo}'/>"><i class="icon-edit">editar</i></a></td>
                <td><a href="<c:url value='/pages/torneo/delete?id=${torneo.idtorneo}'/>" onclick="if (deleteTorneo()) { return true; } else { return false; }"><i class="icon-remove">eliminar</i></a></td>
            </tr>
        </c:forEach>
    </table>
    </div>
</div>
</body>
</html>